import {
  PROCESS_STATUS_MAP,
} from '@/tools/common.js'
export function processedColumns(){
  return  [
    {
      title: '标题',
      key: "wfTittle",
      minWidth: 400
    },
    {
      title: '业务单元',
      key: 'trgNode'
    },
    {
      title: '发起人',
      key: "submitterName",
    },
    {
      title: '发起时间',
      key: "approveDate",
    },
    {
      title: '审批人',
      key: "approverName",
    },
    {
      title: '审批结果',
      key: "operateStatus",
      render: (h, params) => {
        return h('span', PROCESS_STATUS_MAP[params.row.operateStatus] || '')
      }
    },
    {
      title: '审批时间',
      key: "approveDate",
    },
    {
        title: '操作',
        align: "left",
        fixed: "right",
        width: 60,
        render: (h, params) => {
          return h("RowTools", {
            props: {
              data: [
                {
                  type: "text",
                  text: '查看',
                  handle: () => {
                    this.goDetail(params.row);
                  }
                }
              ]
            }
          });
        }
      }
  ]

}

export function unhandledColumns(){
  return  [
    // {
    //   type: "selection",
    //   width: 45,
    //   align: "center"
    // },
    {
      title: '标题',
      key: "wfTittle",
      minWidth: 400
    },
    {
      title: '业务单元',
      key: 'trgNode'
    },
    {
      title: '发起人',
      key: "submitterName",
    },
    {
      title: '发起时间',
      key: "submitDate",
    },
    {
      title: '审批人',
      key: "approverList",
    },
    {
        title: '操作',
        align: "left",
        fixed: "right",
        width: 60,
        render: (h, params) => {
          return h("RowTools", {
            props: {
              data: [
                {
                  type: "text",
                  text: '查看',
                  handle: () => {
                    this.goDetail(params.row);
                  }
                },
              ]
            }
          });
        }
      }
  ]

}

export const columnListUnhande = [
  { columnKey: 'wfTittle', columnName: '标题', minWidth: 400 },
  { columnKey: 'todoType', columnName: '类型' },
  { columnKey: 'trgNode', columnName: '业务单元', disabled: true },
  { columnKey: 'submitterName', columnName: '发起人' },
  { columnKey: 'submitDate', columnName: '发起时间' },
  { columnKey: 'approverList', columnName: '审批人' },
]

export const columnListProcessed = [
  { columnKey: 'wfTittle', columnName: '标题', minWidth: 400 },
  { columnKey: 'toDoType', columnName: '类型' },
  { columnKey: 'trgNode', columnName: '业务单元', disabled: true },
  { columnKey: 'submitterName', columnName: '发起人' },
  { columnKey: 'submitDate', columnName: '发起时间' },
  { columnKey: 'approverName', columnName: '审批人' },
  {
    columnName: '审批结果', columnKey: 'operateStatus', render: (h, params) => {
      return h('span', PROCESS_STATUS_MAP[params.row.operateStatus] || '')
    }
  },
  { columnKey: 'approveDate', columnName: '审批时间' },
]
